package com.hmdp.controller;


import com.hmdp.dto.Result;
import com.hmdp.service.IBlogService;
import com.hmdp.service.IFollowService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 虎哥
 * @since 2021-12-22
 */
@RestController
@RequestMapping("/follow")
public class FollowController {
    @Resource
    private IFollowService followService;

    /**
     * 关注
     * @param id
     * @param isFollow
     * @return
     */
    @PutMapping("/{id}/{isFollow}")
    public Result followUser(@PathVariable Long id, @PathVariable Boolean isFollow){
        return followService.followUser(id,isFollow);
    }
    @GetMapping("/or/not/{id}")
    public Result isFollowed(@PathVariable Long id){
        return followService.isFollowed(id);
    }
    //共同关注
    @GetMapping("common/{id}")
    public Result commonFollow(@PathVariable Long id){
        return followService.commonFollow(id);
    }
}